<!DOCTYPE html>
<html>
<head>
    {include file="_Fragment/meta" /}
    <!-- 样 式 文 件 -->
    <link rel="stylesheet" href="/static/pear/component/pear/css/pear.css" />
    <link rel="stylesheet" href="/static/pear/admin/css/other/login.css" />
    <style>
        .layadmin-user-login-footer {
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            line-height: 30px;
            padding: 20px;
            text-align: center;
            box-sizing: border-box;
            color: rgba(0,0,0,.5);
        }
    </style>
</head>
<!-- 代 码 结 构 -->
<body background="/static/pear/admin/images/background.svg" style="background-size: cover;">
<form class="layui-form" action="javascript:void(0);">
    <div class="layui-form-item">
        <img class="logo" style="margin-left: -40px !important;" src="/static/pear/admin/images/logo.png" />
        <div class="title">学在欧莱雅后台管理系统</div>
        <div class="desc">
            让 数 字 化 技 术 提 升 学 习 效 率
        </div>
    </div>
    <div class="layui-form-item">
        <input type="text" name="givenname" placeholder="名 : " lay-verify="required" hover class="layui-input"  />
    </div>
    <div class="layui-form-item">
        <input type="text" name="surname" placeholder="姓 : " lay-verify="required" hover class="layui-input"  />
    </div>
    <div class="layui-form-item">
        <input type="text" name="email" placeholder="邮    箱 : " lay-verify="required" hover class="layui-input"  />
    </div>
    <div class="layui-form-item">
        <input type="text" name="captcha" placeholder="验证码 : "  hover  lay-verify="required" class="code layui-input layui-input-inline"  />
        <img src="{:url('Login/verify')}?_=" onclick="refresh_verify()" id="verify" class="codeImage" />
    </div>
    <div class="layui-form-item">
        <button type="button" class="pear-btn pear-btn-success login" lay-submit lay-filter="login">
            登 入
        </button>
    </div>

</form>
<div class="layui-trans layadmin-user-login-footer">

    <p>
        <a href="https://www.beian.gov.cn/portal/registerSystemInfo?recordcode=31010602000131" target="_blank">沪公安网备 31010602000131号</a>
        &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
        <a href="https://beian.miit.gov.cn/spare.html#/Integrated/index" target="_blank">沪ICP备08100043号-49</a>
    </p>
</div>
<!-- 资 源 引 入 -->
{include file="_Fragment/javascript" /}
<script>
    function refresh_verify() {
        document.getElementById("verify").src += "0";
    };
    layui.use(['jquery', 'form', 'button', 'popup'], function() {
        var form = layui.form;
        var button = layui.button;
        var popup = layui.popup;
        let $ = layui.jquery;

        // 登 录 提 交
        form.on('submit(login)', function(obj) {

            /// 验证

            /// 登录

            /// 动画
            button.load({
                elem: '.login',
                time: 1500,
                done: function() {

                    $.post("{:url('doLogin')}", obj.field, function (json) {
                        if(json.code == 200) {
                            layer.msg('登陆成功，页面正在跳转', {
                                offset: '15px'
                                ,icon: 1
                                ,time: 1000
                            }, function(){
                                location.href = '/';
                            });
                        } else {
                            refresh_verify();
                            layer.msg(json.msg, {
                                offset: '15px'
                                ,icon: 2
                                ,time: 1000
                            })
                        }
                    });


                }
            })
            return false;
        });
    })
</script>
</body>
</html>
